package com.project.controller;

import com.project.bean.CommodityBean;
import com.project.bean.CutPageBean;
import com.project.service.ICommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("commodity")
public class CommodityController {
    @Autowired
    private ICommodityService service;

    @RequestMapping("findByItem")
    public CutPageBean<CommodityBean> findByItem(int pageNO, String name){
        return service.findByItem(pageNO,name);
    }

    @RequestMapping("findById")
    public CommodityBean findById(int id){

        return service.findById(id);
    }
}
